package com.cari.oa.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cari.oa.dao.BaseDao;
import com.cari.oa.dao.SoftRiskDao;
import com.cari.oa.domain.SoftRiskEntity;

@Service
@Transactional(rollbackFor = Exception.class)
public class SoftRiskService extends BaseService<SoftRiskEntity> {
	
	@Resource
	private SoftRiskDao softRiskDao;

	@Override
	public BaseDao<SoftRiskEntity> getDao() {
		return softRiskDao;
	}
    /**
    * Title: getPage
    * Description:分页获取风险列表
    * @author    hjx 
    * @date       2013-1-21 
    * @param riskType
    * @param status
    * @param projectId
    * @param page
    * @param size
    * @return
    */
	@Transactional(readOnly = true)
    public List<SoftRiskEntity> getPage(String riskType, String status,String projectId, int page, int size) {
    	return softRiskDao.getPage(riskType, status, projectId, page, size);
    }
    
   /**
   * Title: getCount
   * Description:查询的记录数
   * @author    hjx 
   * @date       2013-1-21 
   * @param riskType
   * @param status
   * @param projectId
   * @return
   */
	@Transactional(readOnly = true)
    public long getCount(String riskType, String status,String projectId) {
    	return softRiskDao.getCount(riskType, status, projectId);
    }	
}
